/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #fff;
    --bg-light: #f8f9fa;
    --border-color: #e9ecef;
    --shadow: 0 2px 20px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 40px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色主题变量 */
[data-theme="dark"] {
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --bg-color: #1a1a1a;
    --bg-light: #2d2d2d;
    --border-color: #404040;
    --shadow: 0 2px 20px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 40px rgba(0,0,0,0.4);
}

[data-theme="dark"] .nav {
    background: rgba(26, 26, 26, 0.95);
}

[data-theme="dark"] .lang-btn:hover:not(.active) {
    background: var(--bg-light);
}
body.dark-theme {
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --bg-color: #1a1a1a;
    --bg-light: #2d2d2d;
    --border-color: #404040;
    --shadow: 0 2px 20px rgba(0,0,0,0.3);
    --shadow-hover: 0 8px 40px rgba(0,0,0,0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

body.dark-theme .nav {
    background: rgba(26, 26, 26, 0.95);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* 导航控制区域 */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* 语言切换器样式 */
.language-switcher {
    display: flex;
    background: var(--bg-light);
    border-radius: 25px;
    padding: 4px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.lang-btn:hover:not(.active) {
    background: var(--bg-color);
    color: var(--primary-color);
}

body.dark-theme .lang-btn:hover:not(.active) {
    background: var(--bg-light);
}

/* 主题切换按钮 */
.theme-toggle {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

.theme-toggle:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: scale(1.1);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: var(--transition);
}

/* 首页英雄区域 */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="rgba(255,255,255,0.1)"/><stop offset="100%" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><circle cx="20" cy="10" r="8" fill="url(%23a)" opacity="0.3"><animate attributeName="r" values="8;12;8" dur="3s" repeatCount="indefinite"/></circle><circle cx="80" cy="5" r="6" fill="url(%23a)" opacity="0.2"><animate attributeName="r" values="6;9;6" dur="4s" repeatCount="indefinite"/></circle></svg>') repeat;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.typing-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid white;
    animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: white; }
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background: var(--bg-color);
}

.btn-secondary:hover {
    background: white;
    color: var(--primary-color);
}

/* 区块标题 */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 关于我部分 */
.about {
    padding: 5rem 0;
    background: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    line-height: 1.8;
}

.about-image img {
    width: 100%;
    max-width: 400px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.about-image img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

/* 技术栈样式 */
.tech-stack {
    margin: 2rem 0;
}

.tech-category {
    margin-bottom: 1.5rem;
}

.tech-category h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

/* 深色主题下的技术标签样式 */
[data-theme="dark"] .tech-tag.expert {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

[data-theme="dark"] .tech-tag.proficient {
    background: linear-gradient(135deg, #4834d4, #686de0);
    color: white;
}

[data-theme="dark"] .tech-tag.learning {
    background: linear-gradient(135deg, #00d2d3, #54a0ff);
    color: white;
}

/* 深色主题下的时间线样式 */
[data-theme="dark"] .timeline::before {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

[data-theme="dark"] .timeline-item::before {
    background: var(--bg-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .timeline-content {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .timeline-content::before {
    border-left-color: var(--bg-light);
}

/* 深色主题下的成就卡片样式 */
[data-theme="dark"] .achievement-item {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .achievement-item:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

/* 深色主题下的项目卡片样式 */
[data-theme="dark"] .project-card {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .project-card:hover {
    box-shadow: var(--shadow-hover);
}

[data-theme="dark"] .project-tech-tag {
    background: var(--bg-color);
    color: var(--text-light);
}

/* 深色主题下的联系表单样式 */
[data-theme="dark"] .contact-content {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background: var(--bg-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: var(--text-light);
}

/* 深色主题下的社交媒体链接样式 */
[data-theme="dark"] .social-link {
    background: var(--bg-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .social-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
}

/* 深色主题下的技能条样式 */
[data-theme="dark"] .skill-bar {
    background: var(--bg-light);
}

[data-theme="dark"] .skill-progress {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* 深色主题下的页脚样式 */
[data-theme="dark"] .footer {
    background: var(--bg-light);
    border-top-color: var(--border-color);
}

/* 深色主题下的按钮样式 */
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-light);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.skill-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.skill-info span {
    font-weight: 500;
    color: var(--text-color);
}

.skill-percentage {
    color: var(--primary-color);
    font-weight: 600;
}

.skill-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 2s ease-out;
    width: 0;
}

.skill-progress.animate {
    width: var(--width);
}

/* 项目部分 */
.projects {
    padding: 5rem 0;
    background: var(--bg-light);
}

.projects-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.project-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.project-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tech span {
    padding: 0.25rem 0.75rem;
    background: var(--bg-light);
    color: var(--primary-color);
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.project-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.project-link:hover::after {
    width: 100%;
}

/* 联系部分 */
.contact {
    padding: 5rem 0;
    background: var(--bg-color);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h3,
.contact-form-container h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-info p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.contact-list {
    list-style: none;
    margin-bottom: 2rem;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.contact-list i {
    width: 20px;
    color: var(--primary-color);
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.contact-link:hover {
    color: var(--secondary-color);
}

/* 社交媒体链接 */
.social-media h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.social-links-horizontal {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: var(--transition);
    font-weight: 500;
}

.social-link-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.social-icon {
    font-size: 1.1rem;
}

/* 联系表单 */
.contact-form-container {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.contact-form-container p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-color);
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.submit-button:active {
    transform: translateY(0);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

body.dark-theme .form-message.success {
    background: #1e3a2e;
    color: #7dd3a0;
    border-color: #2d5a3d;
}

body.dark-theme .form-message.error {
    background: #3a1e2e;
    color: #d37d7d;
    border-color: #5a3d2d;
}

/* 页脚 */
.footer {
    background: var(--bg-light);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    color: var(--text-light);
    margin: 0;
}

.footer .social-links {
    display: flex;
    gap: 1rem;
}

.footer .social-link {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer .social-link:hover {
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-content {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .social-links-horizontal {
        justify-content: center;
    }
    
    .language-switcher {
        order: -1;
    }
    
    .nav-controls {
        gap: 0.5rem;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .about-content,
    .contact-content {
        gap: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card {
        margin: 0 auto;
        max-width: 100%;
    }
    
    .achievement-list {
        grid-template-columns: 1fr;
    }
    
    .social-links-horizontal {
        flex-direction: column;
        align-items: center;
    }
    
    .social-link-contact {
        width: 100%;
        justify-content: center;
    }
}

/* 动画效果 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease-out;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 项目卡片动画 */
.project-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 技能条动画 */
.skill-progress {
    transition: width 2s ease-out;
}

/* 表单输入验证样式 */
.form-group input:invalid,
.form-group textarea:invalid {
    border-color: #ff6b6b;
}

.form-group input:valid,
.form-group textarea:valid {
    border-color: #51cf66;
}

.form-group input:focus:invalid,
.form-group textarea:focus:invalid {
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.form-group input:focus:valid,
.form-group textarea:focus:valid {
    box-shadow: 0 0 0 3px rgba(81, 207, 102, 0.1);
}